//
//  QQRequestManager+handle.h
//  LClass
//
//  Created by 严军 on 16/5/29.
//  Copyright © 2016年 YanJun. All rights reserved.
//

#import "QQRequestManager.h"

//服务器根地址
//#define URL_Sever @"http://10.20.16.66:8080/iclass/"
#define URL_Sever @"http://121.42.157.177:8080/iclass/"

/*             用户相关                 */
//登录 GET: username/password
#define URL_login [URL_Sever stringByAppendingString:@"user/login"]

//注册 POST: userName/passWord/realName/position/QQ/email/telephone
#define URL_register [URL_Sever stringByAppendingString:@"user/register"]

//用户课程 GET: userId
#define URL_course [URL_Sever stringByAppendingString:@"course/getcourselistById"]

//获取考勤名单 GET: courseId
#define URL_kaoqinData [URL_Sever stringByAppendingString:@"student/getStudentList"]

//提交考勤 POST: paraMap{}
#define URL_checkWork [URL_Sever stringByAppendingString:@"checkwork/submit"]

//提交考勤 GET: courseId
#define URL_allCheckData [URL_Sever stringByAppendingString:@"checkwork/allcheck"]



@interface QQRequestManager (handle)

/*
 *操作本地数据库NSUserDeful
 *
 */

-(void)SET_userInfo:(NSDictionary*)infoDic;

-(NSDictionary*)GET_userInfo;

/**
 *  登录
 *  @param parameters userName/passWord
 *  @param success  default
 *  @param failure  default
 *  
 *  @return default
 */
-(NSURLSessionDataTask *)GET_loginWithParameters:(id)parameters success:(void(^)(NSURLSessionDataTask* task,id responseObject)) success failure:(void(^)(NSURLSessionDataTask* task,NSError *error)) failure;

/**
 *  注册
 *  @param parameters userName/passWord/realName/position/QQ/email/telephone
 *  @param success  default
 *  @param failure  default
 *
 *  @return default
 */
-(NSURLSessionDataTask *)GET_registerWithParameters:(id)parameters success:(void(^)(NSURLSessionDataTask* task,id responseObject)) success failure:(void(^)(NSURLSessionDataTask* task,NSError *error)) failure;

/**
 *  用户课程列表
 *  @param parameters userId
 *  @param success  default
 *  @param failure  default
 *
 *  @return default
 */
-(NSURLSessionDataTask *)GET_courseWithParameters:(id)parameters success:(void(^)(NSURLSessionDataTask* task,id responseObject)) success failure:(void(^)(NSURLSessionDataTask* task,NSError *error)) failure;

/**
 *  考勤数据
 *  @param parameters ??
 *  @param success  default
 *  @param failure  default
 *  @http://10.20.16.66:8080/iclass/student/getStudentList?courseId=5
 *  @return default
 */
-(NSURLSessionDataTask *)GET_kaoQinDataWithParameters:(id)parameters success:(void(^)(NSURLSessionDataTask* task,id responseObject)) success failure:(void(^)(NSURLSessionDataTask* task,NSError *error)) failure;

/**
 *  提交考勤
 *  @param parameters paraMap:{list:[{'studentId':24,'courseId':23,'mark':0(0:到位 1：缺勤 2：请假)}]}
 *  @param success  default
 *  @param failure  default
 *
 *  @return default
 */
-(NSURLSessionDataTask *)GET_submitCheckDataWithParameters:(id)parameters success:(void(^)(NSURLSessionDataTask* task,id responseObject)) success failure:(void(^)(NSURLSessionDataTask* task,NSError *error)) failure;

/**
 *  获取总考勤信息
 *  @param parameters courseId
 *  @param success  default
 *  @param failure  default
 *
 *  @return default
 */
-(NSURLSessionDataTask *)GET_allCheckDataWithParameters:(id)parameters success:(void(^)(NSURLSessionDataTask* task,id responseObject)) success failure:(void(^)(NSURLSessionDataTask* task,NSError *error)) failure;

@end
